<extend name="Public:common" />
<!--/sidebar-->
<block name="content">
  <div class="main-wrap">

    <div class="crumb-wrap">
      <div class="crumb-list"> <i class="icon-font"></i>
        <a href="__MODULE__/Index/index">首页</a>
        <span class="crumb-step">&gt;</span>
        <a class="crumb-name" href="__MODULE__/Rbac/role">角色分组列表</a>
        <span class="crumb-step">&gt;</span>
        <span>新增角色</span>
      </div>
    </div>
    <div class="result-wrap">
      <div class="result-content">
        <form action="__MODULE__/Rbac/addrole" method="post" id="login" name="login" onsubmit="return Validator.ValidateForm(this,3);">
          <input type='hidden' name='action' value='add' />
          <table class="insert-tab" width="100%">
            <tbody>
              <tr>
                <th width="120"> <i class="require-red">*</i>
                  角色中文名：
                </th>
                <td>
                  <input class="common-text input" type='text' id='remark' dataType="Custom"  name='name' size='30' regexp="^[\u4E00-\u9FA5]{1,10}$"  msg="（中文不能超过10个汉字)" onBlur="Validator.Validate(this)"/>
                  <span id='remarkWarning'>(中文角色名)</span>
                </td>
              </tr>
<!--               <tr>
                <th width="120">
                  <i class="require-red">*</i>
                  角色名：
                </th>
                <td>
                  <input class="common-text input" type='text' id='name' dataType="Custom"  name='name' size='30' regexp="^\w{4,15}$"  msg="（输入字母、数字或下划线（5-16位），必须以字母开头）" onBlur="Validator.Validate(this)"/>
                  <span id='nameWarning'></span>
                </td>
              </tr> -->
              <tr>
                <th width="120">
                  <i class="require-red">*</i>
                  父角色：
                </th>
                <td>
                  <select name='pid'>
                    <option value='0'>|-- 父角色</option>
                    <volist name='rlist' id='vo'>
                      <option value='<{$vo.id}>'>|--
                        <{$vo.name}></option>
                      </volist>
                    </select>
                  </td>
                </tr>
                <tr>
                  <th width="120">
                    <i class="require-red">*</i>
                    状态：
                  </th>
                  <td>
                    <input type='radio' name='status' value='1' checked />
                    开启&nbsp;&nbsp;
                    <input type='radio' name='status' value='0' />
                    关闭
                  </td>
                </tr>
                <tr>
                  <th width="120">
                    <i class="require-red">*</i>
                    权限：
                  </th>
                  <td>
                    <style>
                #all li input{
                  margin:15px;
                }
                #all li{
                  font-family : KaiTi;
                  width:250px;
                  display:inline-block;
                  margin :2px;
                  box-shadow: 5px 5px 5px #888888;
                  border-radius:25px;
                  -moz-border-radius:25px; /* Old Firefox */
                }
                #all li.one{
                  border:1px solid red;
                  text-shadow: 5px 5px 5px #FFA68E;
                }
                #all li.two{
                  border:1px solid blue;
                  text-shadow: 5px 5px 5px #74B1FF;
                }
                #all li.three{
                  border:1px solid orange;
                  text-shadow: 5px 5px 5px #74af33;
                }
                
                
                    </style>
                    <ul id='all'>
                      <volist name='nlist' id='vo'>
                        <!-- 第一层 项目权限 -->
                        <li class='one'>
                          <input type='checkbox' name='node[]' value="<{$vo['id']}>"
                          <?php echo in_array($vo['id'],$Rone['node'])==true?"checked class='chkcss'":'';?>
                          />
                          <{$vo['title']}></li>

                          <hr />
                          <ul>
                            <volist name='vo["children"]' id="vo2">
                              <li class='two'>
                                <input type='checkbox' name='node[]' value="<{$vo2['id']}>
                                "
                                <?php echo in_array($vo2['id'],$Rone['node'])==true?"checked class='chkcss'":'';?>
                                />
                                <{$vo2['title']}></li>
                                <ul class="right">
                                  <volist name='vo2["children"]' id="vo3">
                                    <li class='three'>
                                      <input type='checkbox' name='node[]' value="<{$vo3['id']}>
                                      "
                                      <?php echo in_array($vo3['id'],$Rone['node'])==true?"checked class='chkcss'":'';?>
                                      />
                                      <{$vo3['title']}></li>
                                    </volist>
                                  </ul>
                                  <hr ></volist>
                                <ul></volist>
                              </ul>
                            </td>
                          </tr>
                          <tr>
                            <td></td>
                            <td>
                              <input class="btn btn-primary btn6 mr10" value="创建" type="submit">
                              <input class="btn btn6"  onclick="history.go(-1)" value="返回" type="button"></td>
                          </tr>
                        </tbody>
                      </table>
                      <script>
                      //点击 li 标签 就会触发点击时间0
                        $("#all li").mouseover(function(){
                              color = $(this).css("background-color"); 
                            $(this).css("background-color","#FFF500");
                        }).mouseout(function(){
                            $(this).css("background-color",color);
                        }).click(function(){
                            $(this).find("input").trigger("click").parent();
                          });
                    </script>
                    </form>
                  </div>
                </div>

              </div>
              <!--/main--> </block>